Release 10.1A: OpenEdge Development:
AppBuilder
Adding a widget to a palette button pop-up menu
You create and define custom widgets in a custom object file. Here is the syntax for adding custom widgets:
*widget-typeSpecifies the type of custom widget to create. It must be one of the following:
BROWSE,BUTTON,COMBO-BOX,EDITOR,FILL-IN,FRAME,IMAGE,RADIO-SET,RECTANGLE,SELECTION-LIST,TEXT, andTOGGLE-BOX.nameSpecifies the display name of the custom widget as it appears on the Palette submenu (or pop-up menu on the Palette). After you choose a widget, AppBuilder displays
display-name, followed bywidget-type, in the status bar of AppBuilder main window.DESCRIPTION [description-text-string]Specifies the description of the widget. The description helps another developer to read and understand the intent of each custom widget.
attributeSpecifies an attribute to set for the widget. You can specify any attribute that you can also set from the widget’s property sheet. See Table C–2, later in this appendix, for a list of the attributes that you can specify and the widgets to which they can apply.
valueSpecifies the value for
attribute(based on the data type of the attribute).INHERITname-of-entrySpecifies the display name of another widget in the custom widgets file. The current widget inherits all of the attribute settings specified for the other widget. If attribute settings conflict, the latter setting applies.
trigger-blockSpecifies a trigger for the custom widget:
In this syntax,
eventspecifies an event to pair with the custom widget andtrigger-codespecifies the code statements to execute for the widget/event pair.RUNfile-nameSpecifies a procedure to run immediately before the object is created. The procedure file can take two parameters:
INPUTp_idAS INTEGER NO-UNDO- The context ID of the object being created.OUTPUTp_sctAS CHAR NO-UNDO- A list of new custom object entries to process.You can have multiple
RUNstatements for a single custom object file; they are run sequentially. Do not end aRUNstatement line with a trailing period (.).Table C–2 describes the attributes you can set in the custom objects file and the widgets to which they apply. In the Data Type column:
CindicatesCHARACTERPindicatesPIXELSIindicatesINTEGERLindicatesLOGICAL
Sample widget entry
The following sample entry is in the
src/template/progress.cstfile:
If you analyze this sample entry one section at a time, you can see how to write your own custom widget entry. In this example:
- The first line specifies the widget type
BUTTONand the display name for the widget:
AppBuilder displays this name in the appropriate Object Palette menus. The ampersand (&) specifies that the “x” is the mnemonic on the Object Palette menu.
- The second line describes the button’s functionality:
AppBuilder does nothing with this description. The description is meant as a summary for someone reading the custom object file.
- The third line names another custom widget (Custom Size/Color) in the
progress.cstfile by using the widget’s display name:
The current widget (Next) inherits all of the attribute settings for the Custom Size/Color button. Where you place the
INHERITkeyword affects how attributes are set. Later definitions override earlier definitions.- The fourth line specifies the label of the button:
The ampersand (&) specifies that “N” is the mnemonic for the button.
- The fifth line specifies the widget name that AppBuilder uses internally to refer to the button:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |